home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_05
/
9n05069a
< prev
next >
Wrap
Text File
|
1991-03-02
|
2KB
|
70 lines
#include "stdio.h"
main()
{
char cin, CR = '\n',
NUL = '\000', SOH = '\001',
SI = '\017', DC2 = '\022',
ESC = '\033';
FILE *fp;
if ((fp = fopen("PRN:", "W")) == NUL)
{
fprintf(stderr, " Unable to open PRN:");
exit();
}
{
fprintf(fp," This for the Line Printer \n");
printf (" SetAmstr.C v 2.1 for MIX Compiler - 12 November 1990.\n");
printf (" Copyright: A. E. Molony,\n");
printf (" 55 Selwyn Street,\n");
printf (" North East Valley,\n");
printf (" DUNEDIN, NZ.\n");
printf (" MENU. \n");
printf (" ON OFF\n");
printf (" B b Bold print\n");
printf (" C c Double strike\n");
printf (" D d Double width\n");
printf (" E e Mini 'Elite' 10 pt\n");
printf (" G g Compr 'Gothic' 8 pt\n");
printf (" I i Italics (Not available in NLQ\n");
printf (" N n NLQ (Near Letter Quality\n");
printf (" O o NLQ - proportional\n");
printf (" P p Draft - proportional\n");
printf (" U u Underline\n");
printf (" Enter choice from above: \n");
while ((cin = getchar()) != EOF)
{
fprintf(fp," Present setting: \n");
if (cin == 'B') fprintf(fp,"%cE", ESC);
if (cin == 'b') fprintf(fp,"%cF", ESC);
if (cin == 'C') fprintf(fp,"%cG", ESC);
if (cin == 'c') fprintf(fp,"%cH", ESC);
if (cin == 'D') fprintf(fp,"%cW%c", ESC, SOH);
if (cin == 'd') fprintf(fp,"%cW%c", ESC, NUL);
if (cin == 'E') fprintf(fp,"%cM", ESC);
if (cin == 'e') fprintf(fp,"%cP", ESC);
if (cin == 'G') fprintf(fp,"%c%c", ESC, SI);
if (cin == 'g') fprintf(fp,"%c", DC2);
if (cin == 'I') fprintf(fp,"%c4", ESC);
if (cin == 'i') fprintf(fp,"%c5", ESC);
if (cin == 'N') fprintf(fp,"%cx%c", ESC, SOH);
if (cin == 'n') fprintf(fp,"%cx%c", ESC, NUL);
if (cin == 'O') fprintf(fp,"%cx%c%cp%c",
ESC, SOH, ESC, SOH);
if (cin == 'o') fprintf(fp,"%cx%c%cp%c",
ESC, NUL, ESC, NUL);
if (cin == 'P') fprintf(fp,"%cp%c", ESC, SOH);
if (cin == 'p') fprintf(fp,"%cp%c", ESC, NUL);
if (cin == 'U') fprintf(fp,"%c-%c", ESC, SOH);
if (cin == 'u') fprintf(fp,"%c-%c", ESC, NUL);
fprintf(fp," Setting after adjustment: \n");
}
}
exit(0);
}